package com.zx.platform.service;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;

import com.zx.platform.service.domain.OperatorInfoDomain;
import com.zx.platform.service.model.MenusModel;
import com.zx.platform.service.model.OperatorInfoModel;
import com.zx.platform.service.model.OperatorRolesModel;
import com.zx.platform.service.model.RolesModel;

/**
 * Created by IntelliJ IDEA. User: Administrator Date: 14-3-1 Time: 上午11:06 To
 * change this template use File | Settings | File Templates.
 */
public interface OperatorInfoService {

	/**
	 * 查找所有数据列表
	 * 
	 * @return
	 * @throws DataAccessException
	 */
	public List getAllList() throws DataAccessException;

	/**
	 * 根据单Key查找Model
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public OperatorInfoModel getModelByKey(String key) throws DataAccessException;

	/**
	 * 根据Model查找列表
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public List<OperatorInfoModel> getListByModel(OperatorInfoModel model) throws DataAccessException;
	/**
	 * 检验唯一性
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public List<OperatorInfoModel> checkSingle(OperatorInfoModel model) throws DataAccessException;
	/**
	 * 密码检验
	 * 
	 * @param key
	 * @return
	 * @throws DataAccessException
	 */
	public List passOrNotByModel(OperatorInfoModel model) throws DataAccessException;

	/**
	 * 新增并返回主键
	 * 
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public String add(OperatorInfoModel model) throws DataAccessException;

	/**
	 * 更新并返回主键
	 * 
	 * @param directoryModel
	 * @throws DataAccessException
	 */
	public String update(OperatorInfoModel model) throws DataAccessException;

	/**
	 * 删除
	 * 
	 * @param pageSize
	 * @param pageNum
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public void delete(OperatorInfoModel model) throws DataAccessException;

	/**
	 * 分页查询
	 * 
	 * @param pageSize
	 * @param pageNum
	 * @param directoryModel
	 * @return
	 * @throws DataAccessException
	 */
	public Map getPageByDomain(int pageSize, int pageNum,
			OperatorInfoDomain domain) throws DataAccessException;
	/**
	 * 设置角色
	 * 是先删除再新增
	 */
	public String setOperatorRoles(OperatorRolesModel model) throws DataAccessException;
	/**
	 * 查出当前用户拥有的角色
	 */
	public List<RolesModel> getRoleListByOperatorId(String operatorId) throws DataAccessException;
	/**
	 *根据登录名查找操作员 
	 */
	public OperatorInfoModel getModelByAgentInfo(OperatorInfoModel model) throws DataAccessException;
	/**
	 * 根据操作员id获得拥有的权限菜单
	 */
	public List<MenusModel> getMenuListByOperatorId(String operatorId) throws DataAccessException;

	Map resetPwdBySysAccount(String sysAccount) throws Exception;
}
